package com.zj.ecology;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.zj.base.view_injector.ViewBinder;
import com.zj.base.view_injector.annotantions.IdRes;

/**
 * Created by zhaojie on 2018/6/5.
 */

public class ViewBinderView extends FrameLayout {
    public ViewBinderView(@NonNull Context context) {
        super(context);
        init(context);
    }

    public ViewBinderView(@NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        init(context);
    }

    public ViewBinderView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init(context);
    }

    @IdRes(R.id.tvName)
    private TextView tvName;
    @IdRes(R.id.tvTime)
    private TextView tvTime;


    private void init(Context context) {
        View v = inflate(context, R.layout.view_vb, this);
        ViewBinder.bind(this, v);
        tvName.setText("asdasda");
        tvTime.setText("1231234123");
    }
}
